/*
 Navicat Premium Dump SQL

 Source Server         : localhost-mysql
 Source Server Type    : MySQL
 Source Server Version : 80040 (8.0.40)
 Source Host           : localhost:3306
 Source Schema         : my_blog_test

 Target Server Type    : MySQL
 Target Server Version : 80040 (8.0.40)
 File Encoding         : 65001

 Date: 05/02/2025 16:32:40
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for sys_dict
-- ----------------------------
DROP TABLE IF EXISTS `sys_dict`;
CREATE TABLE `sys_dict` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '字典id(规则)',
  `sys_dict_type_id` int NOT NULL COMMENT '关联sys_dict_type id',
  `code_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '字典名称',
  `alias` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '字典（Key）别名，某些情况下如果不想使用id作为key',
  `sort` int NOT NULL DEFAULT '10' COMMENT '排序(正序)',
  `callback_show_style` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '回显样式',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '备注',
  `is_lock` int NOT NULL DEFAULT '0' COMMENT '是否锁定',
  `is_show` int NOT NULL DEFAULT '0' COMMENT '是否展示',
  `del_flag` int NOT NULL DEFAULT '0' COMMENT '是否删除',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `delete_time` datetime DEFAULT NULL,
  `create_id` int DEFAULT NULL,
  `update_id` int DEFAULT NULL,
  `delete_id` int DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `type` (`sys_dict_type_id`),
  KEY `code_name` (`code_name`)
) ENGINE=InnoDB AUTO_INCREMENT=1007009 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='用户标签信息';

-- ----------------------------
-- Records of sys_dict
-- ----------------------------
BEGIN;
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1000001, 1000, '正常', '', 1, 'success', '', 0, 0, 0, '2023-08-20 16:30:23', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1000002, 1000, '禁用', '', 2, 'info', '', 0, 0, 0, '2023-08-20 16:33:45', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1000003, 1000, '禁言', '', 3, 'info', '', 0, 0, 0, '2023-08-20 16:33:54', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1001001, 1001, '测试用户', '', 0, 'info', '', 0, 0, 0, '2023-08-20 16:38:58', '2025-01-28 08:31:51', NULL, NULL, 1, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1001002, 1001, '超级管理员', '', 0, 'info', '', 0, 0, 0, '2023-08-20 16:39:05', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1002001, 1002, '目录', '', 1, 'warning', '', 0, 0, 0, '2023-08-21 11:23:05', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1002002, 1002, '菜单', '', 2, 'success', '', 0, 0, 0, '2023-08-21 11:23:17', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1002003, 1002, '按钮', '', 3, 'danger', '', 0, 0, 0, '2023-08-21 11:23:22', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1003001, 1003, '正常', '', 1, 'success', '', 0, 0, 0, '2024-01-22 09:44:52', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1003002, 1003, '禁用', '', 2, 'info', '', 0, 0, 0, '2024-01-22 09:45:16', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1004001, 1004, 'PC', '', 1, 'success', 'pc端', 0, 0, 0, '2024-01-22 10:03:19', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1004002, 1004, '小程序', '', 2, 'success', '小程序端', 0, 0, 0, '2024-01-22 10:03:47', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1004003, 1004, 'Androd', '', 3, 'success', '', 0, 0, 0, '2024-01-22 10:04:35', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1004004, 1004, 'IOS', '', 4, 'success', '', 0, 0, 0, '2024-01-22 10:04:42', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1005001, 1005, '密码认证', 'password', 100, 'success', '', 0, 0, 0, '2024-01-22 10:20:32', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1005002, 1005, '小程序认证', 'applet', 300, 'success', '', 0, 0, 0, '2024-01-22 10:20:40', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1005003, 1005, '三方认证', 'third', 400, 'success', '', 0, 0, 0, '2024-01-22 10:20:51', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1005004, 1005, '短信认证', 'sms', 200, 'success', '', 0, 0, 0, '2024-01-22 10:20:57', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1006001, 1006, '全部', '', 1, 'primary', '', 0, 0, 0, '2024-06-25 18:55:48', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1006002, 1006, '本部门及以下', '', 2, 'primary', '', 0, 0, 0, '2024-06-25 18:56:57', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1006003, 1006, '仅本部门', '', 3, 'primary', '', 0, 0, 0, '2024-06-25 18:57:22', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1006004, 1006, '仅本人', '', 4, 'primary', '', 0, 0, 0, '2024-06-25 18:57:57', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1006005, 1006, '自定义', '', 5, 'primary', '', 0, 0, 0, '2024-06-25 18:58:11', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1007001, 1007, '部门权限', '', 1, 'primary', '', 0, 0, 0, '2024-06-25 18:59:00', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1007002, 1007, '个人权限', '', 2, 'primary', '个人权限高优先级', 0, 0, 0, '2024-06-25 18:59:27', '2025-01-17 13:14:58', NULL, NULL, NULL, NULL);
INSERT INTO `sys_dict` (`id`, `sys_dict_type_id`, `code_name`, `alias`, `sort`, `callback_show_style`, `remark`, `is_lock`, `is_show`, `del_flag`, `create_time`, `update_time`, `delete_time`, `create_id`, `update_id`, `delete_id`) VALUES (1007004, 1001, '普通用户', '', 10, NULL, '普通用户', 0, 0, 0, '2025-01-28 08:59:15', '2025-01-28 09:23:50', NULL, NULL, 1, NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '菜单 id',
  `pid` bigint NOT NULL COMMENT '父级 id',
  `path` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '路径',
  `name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '路径名称',
  `label` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '菜单名称',
  `icon` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '图标',
  `url` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '具体路径 但是设计为和 name 一致',
  `sort` int DEFAULT NULL COMMENT '排序',
  `deep` int DEFAULT NULL COMMENT '层级',
  `menu_type_cd` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '菜单类型',
  `permissions` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '权限',
  `has_children` int DEFAULT NULL COMMENT '是否有子集',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `create_id` int DEFAULT NULL COMMENT '创建人',
  `update_id` int DEFAULT NULL COMMENT '更新人',
  `is_delete` int DEFAULT '0' COMMENT '是否删除',
  `is_status` int DEFAULT '1' COMMENT '是否显示',
  PRIMARY KEY (`id`),
  KEY `is_status_index` (`is_status`),
  KEY `is_delete_index` (`is_delete`),
  KEY `name_index` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='菜单表';

-- ----------------------------
-- Records of sys_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_menu` (`id`, `pid`, `path`, `name`, `label`, `icon`, `url`, `sort`, `deep`, `menu_type_cd`, `permissions`, `has_children`, `create_time`, `update_time`, `create_id`, `update_id`, `is_delete`, `is_status`) VALUES (1, 0, '/home', 'home', '首页', 'house', 'home', 0, 1, '菜单', 'sys:user:all', 0, '2025-01-20 16:28:06', '2025-01-25 13:01:44', 1, 1, 0, 0);
INSERT INTO `sys_menu` (`id`, `pid`, `path`, `name`, `label`, `icon`, `url`, `sort`, `deep`, `menu_type_cd`, `permissions`, `has_children`, `create_time`, `update_time`, `create_id`, `update_id`, `is_delete`, `is_status`) VALUES (4, 0, '/system', 'system', '系统管理', 'setting', '/system', 1, 1, '目录', 'sys:user:edit', 1, '2025-01-21 14:08:40', '2025-01-23 15:17:12', 1, 1, 0, 0);
INSERT INTO `sys_menu` (`id`, `pid`, `path`, `name`, `label`, `icon`, `url`, `sort`, `deep`, `menu_type_cd`, `permissions`, `has_children`, `create_time`, `update_time`, `create_id`, `update_id`, `is_delete`, `is_status`) VALUES (5, 4, '/system/menu', 'menu', '菜单管理', 'menu', '/system/menu', 3, 2, '菜单', 'sys:user:edit', 0, '2025-01-21 14:24:36', '2025-01-22 15:50:56', 1, 1, 0, 0);
INSERT INTO `sys_menu` (`id`, `pid`, `path`, `name`, `label`, `icon`, `url`, `sort`, `deep`, `menu_type_cd`, `permissions`, `has_children`, `create_time`, `update_time`, `create_id`, `update_id`, `is_delete`, `is_status`) VALUES (59, 4, '/system/user', 'user', '用户管理', 'user', '/system/user', 2, 2, '菜单', 'sys:user:edit', 0, '2025-01-22 14:50:11', '2025-01-22 15:39:58', 1, 1, 0, 0);
INSERT INTO `sys_menu` (`id`, `pid`, `path`, `name`, `label`, `icon`, `url`, `sort`, `deep`, `menu_type_cd`, `permissions`, `has_children`, `create_time`, `update_time`, `create_id`, `update_id`, `is_delete`, `is_status`) VALUES (60, 4, '/system/role', 'role', '角色管理', 'apple', '/system/role', 4, 3, '菜单', 'sys:user:edit', 0, '2025-01-25 13:09:53', '2025-01-28 21:20:55', 1, 1, 0, 0);
INSERT INTO `sys_menu` (`id`, `pid`, `path`, `name`, `label`, `icon`, `url`, `sort`, `deep`, `menu_type_cd`, `permissions`, `has_children`, `create_time`, `update_time`, `create_id`, `update_id`, `is_delete`, `is_status`) VALUES (65, 4, '/system/log', 'log', '日志管理', 'Platform', '/system/log', 6, 3, '菜单', 'sys:user:edit', 0, '2025-02-02 16:29:59', '2025-02-02 16:31:11', 1, 1, 0, 0);
COMMIT;

-- ----------------------------
-- Table structure for sys_operation_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_operation_log`;
CREATE TABLE `sys_operation_log` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `username` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `operation_desc` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `operation_type` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `class_method` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `client_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `client_ip` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `request_method` varchar(10) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `request_params` text COLLATE utf8mb4_general_ci,
  `response_result` text COLLATE utf8mb4_general_ci,
  `operation_time` datetime DEFAULT NULL,
  `cost_time` bigint DEFAULT NULL,
  `status_code` int DEFAULT NULL,
  `error_message` text COLLATE utf8mb4_general_ci,
  PRIMARY KEY (`id`),
  KEY `username_index` (`username`),
  KEY ```operation_type_index``` (`operation_type`),
  KEY `request_index` (`request_method`),
  KEY `time_index` (`operation_time` DESC) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of sys_operation_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '角色id',
  `role_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色名称',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '简介',
  `del_flag` int NOT NULL DEFAULT '0' COMMENT '删除与否(0未删除，1 删除)',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `create_id` int DEFAULT NULL,
  `update_id` int DEFAULT NULL,
  `is_lock` int NOT NULL DEFAULT '0' COMMENT '是否锁定（0 未锁定 1 锁定）',
  `permissions` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '标识，唯一',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `role_key` (`role_name`) COMMENT '角色名称唯一',
  UNIQUE KEY `permissions_key` (`permissions`) COMMENT '唯一标识'
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='系统角色表';

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` (`id`, `role_name`, `remark`, `del_flag`, `create_time`, `update_time`, `create_id`, `update_id`, `is_lock`, `permissions`) VALUES (1, '超级管理员', '超级管理员权限', 0, '2025-01-17 10:27:12', '2025-01-27 10:46:02', 1, 1, 0, 'admin');
INSERT INTO `sys_role` (`id`, `role_name`, `remark`, `del_flag`, `create_time`, `update_time`, `create_id`, `update_id`, `is_lock`, `permissions`) VALUES (6, '测试用户', '测试用户权限', 0, '2025-01-27 10:45:49', '2025-01-28 08:31:51', 1, 1, 0, 'dev');
INSERT INTO `sys_role` (`id`, `role_name`, `remark`, `del_flag`, `create_time`, `update_time`, `create_id`, `update_id`, `is_lock`, `permissions`) VALUES (18, '普通用户', '普通用户', 0, '2025-01-28 08:59:15', '2025-01-28 09:23:50', NULL, 1, 0, 'user');
COMMIT;

-- ----------------------------
-- Table structure for sys_role_dict
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_dict`;
CREATE TABLE `sys_role_dict` (
  `role_id` int NOT NULL COMMENT '角色 id',
  `tag_id` int NOT NULL COMMENT '用户标签 id'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色和用户标签信息对应表';

-- ----------------------------
-- Records of sys_role_dict
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_dict` (`role_id`, `tag_id`) VALUES (1, 1001002);
INSERT INTO `sys_role_dict` (`role_id`, `tag_id`) VALUES (6, 1001001);
INSERT INTO `sys_role_dict` (`role_id`, `tag_id`) VALUES (18, 1007004);
COMMIT;

-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
  `role_id` int NOT NULL COMMENT '角色 id',
  `menu_id` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '菜单 id',
  PRIMARY KEY (`role_id`),
  KEY `user_id_index` (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户菜单对应表';

-- ----------------------------
-- Records of sys_role_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (1, '1,4,59,5,60,65');
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (18, '');
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'id',
  `username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名',
  `pwd` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码',
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '手机号',
  `nickname` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '昵称',
  `sex` tinyint(1) DEFAULT NULL COMMENT '性别(0 未知 1 男 2 女)',
  `birthday` date DEFAULT NULL COMMENT '生日',
  `logo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '头像地址',
  `age` int DEFAULT NULL COMMENT '年龄，--废弃，以生日为主',
  `id_card` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '身份证',
  `email` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '邮箱地址',
  `account_status_cd` int DEFAULT '1000001' COMMENT '账户状态 (如 冻结；禁言；正常。 关联字典表account_status)',
  `user_tag_cd` int DEFAULT '1001003' COMMENT '标签（自定义关联到字典表）',
  `last_login_time` datetime DEFAULT NULL COMMENT '最近一次登录时间',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `del_flag` int DEFAULT '0' COMMENT '是否删除(0未删除，1 删除)',
  `create_id` int DEFAULT NULL,
  `update_id` int DEFAULT NULL,
  PRIMARY KEY (`id` DESC) USING BTREE,
  KEY `username_index` (`username`) USING BTREE,
  KEY `create_time_index` (`create_time` DESC) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='系统用户表';

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` (`id`, `username`, `pwd`, `phone`, `nickname`, `sex`, `birthday`, `logo`, `age`, `id_card`, `email`, `account_status_cd`, `user_tag_cd`, `last_login_time`, `create_time`, `update_time`, `del_flag`, `create_id`, `update_id`) VALUES (23, 'user', '$2a$10$BYOrrcn.JeQ.uO5c3MBXqudGm47yoVAkrb4vze3ykmHe6cpaLiS0S', '18145957788', '普通用户', 1, '2025-01-25', 'http://1.92.90.200:19111/blog-cloud/user/20250202/a25fa3da-5609-4cfa-941d-0f5c0452ab8f.jpg', NULL, NULL, '187@163.com', 1000001, 1007004, NULL, '2025-01-25 11:46:28', NULL, 0, 1, NULL);
INSERT INTO `sys_user` (`id`, `username`, `pwd`, `phone`, `nickname`, `sex`, `birthday`, `logo`, `age`, `id_card`, `email`, `account_status_cd`, `user_tag_cd`, `last_login_time`, `create_time`, `update_time`, `del_flag`, `create_id`, `update_id`) VALUES (1, 'admin', '$2a$10$dgK3LyX9wZFwCcqh8VK1PuiwkTEDxfwrGQZ/K1y2O8v9F6MDFYFeO', '18133192222', '管理员', 0, '2025-01-12', 'http://1.92.90.200:19111/blog-cloud/user/20250202/311f99d1-61d0-4155-92b3-916378c60dc6.jpg', NULL, NULL, '1919@qq.com', 1000001, 1001002, '2025-02-05 15:19:19', '2025-01-17 14:43:51', '2025-01-24 09:44:14', 0, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `role_id` int NOT NULL COMMENT '角色id (sys_role_id)',
  `user_id` int NOT NULL COMMENT '用户id(sys_user_id)',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='系统用户-角色关联表';

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
